package com.itheima.controller;


import com.itheima.common.PageBean;
import com.itheima.common.R;
import com.itheima.dtos.PageOperateLogDto;
import com.itheima.pojo.OperateLog;
import com.itheima.service.OperateLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@RequestMapping("/logs")
public class OperateLogController {
    @Autowired
    OperateLogService operateLogService;

    //分页查询
    /**
     * 带条件的分页查询
     * @param pageOperateLogDto 条件
     * @return R
     */
    @GetMapping("/pageQuery")
    public R queryAll(PageOperateLogDto pageOperateLogDto){
        PageBean<OperateLog> logs = operateLogService.queryPage(pageOperateLogDto);
        return R.ok(logs);
    }
}
